﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ChineseSchool.Admin
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["Username"] == null || Session["PassWord"] == null || Session["Username"].ToString() == "" || Session["PassWord"].ToString() == "")
                {
                    Response.Redirect("/Login.html#tologin");
                }
                else
                {
                    if (Session["UserType"].ToString() != CheckUserType.QTV && Session["UserType"].ToString() != CheckUserType.SA)
                    {
                        Response.Redirect("/Trang-chu.html");
                    }
                    lblUser.Text = Session["Username"].ToString();
                }
            }
        }

        protected void BtnChangePassClick(object sender, EventArgs e)
        {

        }

        protected void BtnExitClick(object sender, EventArgs e)
        {
            Session["Username"] = "";
            Session["PassWord"] = "";
            Session["UserType"] = "";
            Session.Abandon();
            Session.Clear();
            Response.Redirect("/Trang-chu.html");
        }
    }
}